package xman.mstruts.controller;

import java.net.URLDecoder;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import xman.mstruts.annotation.PropertyConfig;
import xman.mstruts.service.GenericService;

import com.alibaba.fastjson.JSONObject;

@Scope("prototype")
@Controller
public class GenericAction extends AbstractAction {
    private static final Logger logger = Logger.getLogger(GenericAction.class);
    
    // @Resource
    private GenericService genericService;
    
    private String action;
    
    private String data;
    
    public void genericAction() {
        Map actionMap = JSONObject.parseObject(action, Map.class);
        logger.info(action);
    }
    
    public String getAction() {
        logger.info(PropertyConfig.url);
        return action;
    }
    
    public void setAction(String action) {
        try {
            this.action = URLDecoder.decode(action, "utf-8");
        } catch (Exception e) {
        }
    }
    
    public String getData() {
        return data;
    }
    
    public void setData(String data) {
        try {
            this.data = URLDecoder.decode(data, "utf-8");
        } catch (Exception e) {
        }
    }
}
